﻿#--------------------------------------------------------------------------------------------------------------------------------------------------------
#
# Mi-DevEnv			:	http://midevenv.codeplex.com 
#					:	(c) IT Bridge 2012
#					:	A concept originated by Chris Nurse
#
# Licence			:	GNU General Public License version 2 (GPLv2)
#					:	http://midevenv.codeplex.com/license
#
# Summary           :   Install SharePoint 2013
#
#--------------------------------------------------------------------------------------------------------------------------------------------------------

Set-StrictMode -Version Latest

if ((Get-Module MDE-Common) -eq $null) {
    Import-Module MDE-Common
    }

[string]$executionPath = Split-Path $script:MyInvocation.MyCommand.Path -Parent
[bool]$needDC = $true
[bool]$needWebServer = $true

Function InstallProduct() {
    
    if (Get-RunInstallation -Package GetPackageName -RequireDC $needDC -RequireIIS $needWebServer) {

        Set-LowRiskFileTypes ".exe;.ps1;.bat;.vbs;"
        Add-ServiceAccounts -Product SharePoint

        $scriptDir = "MDE_AUTOSP_2013_FOLDER"

        copy $executionPath\AutoSP_Config_2013.xml $scriptDir -Force
        copy $executionPath\AutoSP_Config-OWA_2013.xml $scriptDir -Force
        copy $executionPath\AutoSP_InstallerInput_2013.xml $scriptDir -Force

        cd $scriptDir
        & .\AutoSP_InstallerLaunch.bat
        }
    }

#region Framework

Function GetInstallName() {
    return "SharePoint"
    }
    
Function GetRequireRestart() {
    return $true
    }

Function GetPackageName() {
    return "SP2013"
    }

Function GetPackageDescription() {
    return "SharePoint 2013 (All features)"
    }
    
Function GetServerBuild() {
    return $false 
    }
        
Function GetInstallPriority() {
    return 62000
    }

#endregion
